package com.kgc.controller;


import com.kgc.pojo.Product;
import com.kgc.pojo.User;
import com.kgc.remote.ProductRemote;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
public class OrderController {

    @Resource
    private ProductRemote productRemote;

    @RequestMapping("/getOrderDetail")
    public Object getOrderDetail(){
        Integer productId = 10066;//订单中获取到的商品ID
         User user = new User(1001,"张三");
        Product product = productRemote.getProductById(productId,user);
        System.out.println("服务消费者》获取到远程服务提供的商品信息");
        return product;
    }





}
